package stdying.handyweibo.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

/**
 * Description: UrlShort 短连接
 * Author: liulili
 * Created: 2015-12-24
 */
public class UrlShort implements Parcelable {
    @SerializedName("url_short")
    private String urlShort;

    @SerializedName("url_long")
    private String urlLong;

    private int type;
    private boolean result;

    public boolean isResult() {
        return result;
    }

    public void setResult(boolean result) {
        this.result = result;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getUrlLong() {
        return urlLong;
    }

    public void setUrlLong(String urlLong) {
        this.urlLong = urlLong;
    }

    public String getUrlShort() {
        return urlShort;
    }

    public void setUrlShort(String urlShort) {
        this.urlShort = urlShort;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.urlShort);
        dest.writeString(this.urlLong);
        dest.writeInt(this.type);
        dest.writeByte(result ? (byte) 1 : (byte) 0);
    }

    public UrlShort() {
    }

    protected UrlShort(Parcel in) {
        this.urlShort = in.readString();
        this.urlLong = in.readString();
        this.type = in.readInt();
        this.result = in.readByte() != 0;
    }

    public static final Parcelable.Creator<UrlShort> CREATOR = new Parcelable.Creator<UrlShort>() {
        public UrlShort createFromParcel(Parcel source) {
            return new UrlShort(source);
        }

        public UrlShort[] newArray(int size) {
            return new UrlShort[size];
        }
    };
}
